import store from '@/store'

function judgeEnvironment() {
  if (/MicroMessenger/.test(window.navigator.userAgent)) {
    store.dispatch('public/setENV', 'WX')
    alert('微信客户端')
  } else if (/AlipayClient/.test(window.navigator.userAgent)) {
    store.dispatch('public/setENV', 'ZFB')
    alert('支付宝客户端')
  } else {
    store.dispatch('public/setENV', 'OTHER')
    // alert('其他浏览器')
  }
}
export default {
  judgeEnvironment
}
